package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 车辆减免券实体类
 *
 * @author yourname
 */
public class CarJianMian extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 租户ID */
    private Integer tenantId;

    /** 车辆ID */
    private Long carId;

    /** 会员ID */
    private Long memberId;

    /** 车牌号码 */
    @Xss(message = "车牌号码不能包含脚本字符")
    @Size(min = 0, max = 20, message = "车牌号码长度不能超过20个字符")
    private String carSn;

    /** 减免券编号 */
    @NotBlank(message = "减免券编号不能为空")
    @Size(min = 0, max = 50, message = "减免券编号长度不能超过50个字符")
    private String jianmianSn;

    /** 减免时长（分钟） */
    @NotNull(message = "减免时长不能为空")
    private Integer jmshichang;

    /** 减免类型（in=进场减免，out=出场减免） */
    @NotBlank(message = "减免类型不能为空")
    @Size(min = 0, max = 10, message = "减免类型长度不能超过10个字符")
    private String jmType;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public CarJianMian() {}

    public CarJianMian(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getTenantId() {
        return tenantId;
    }

    public void setTenantId(Integer tenantId) {
        this.tenantId = tenantId;
    }

    public Long getCarId() {
        return carId;
    }

    public void setCarId(Long carId) {
        this.carId = carId;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getCarSn() {
        return carSn;
    }

    public void setCarSn(String carSn) {
        this.carSn = carSn;
    }

    public String getJianmianSn() {
        return jianmianSn;
    }

    public void setJianmianSn(String jianmianSn) {
        this.jianmianSn = jianmianSn;
    }

    public Integer getJmshichang() {
        return jmshichang;
    }

    public void setJmshichang(Integer jmshichang) {
        this.jmshichang = jmshichang;
    }

    public String getJmType() {
        return jmType;
    }

    public void setJmType(String jmType) {
        this.jmType = jmType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("tenantId", getTenantId())
                .append("carId", getCarId())
                .append("memberId", getMemberId())
                .append("carSn", getCarSn())
                .append("jianmianSn", getJianmianSn())
                .append("jmshichang", getJmshichang())
                .append("jmType", getJmType())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
